package top.dreamcenter.ai.common.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class RetResult <T> {

    private Integer code;

    private String msg;

    private T data;

    public static <T> RetResult<T> ok(T data) {
        return new RetResult<>(2000, null, data);
    }

    public static <T> RetResult<T> fail(String msg) {
        return new RetResult<>(4000, msg, null);
    }

}